﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="frmTaoChuongHoc.aspx.cs" Inherits="Admin_frmTaoChuongHoc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 100%">
        <tr>
            <td style="height: 32px; width: 117px;">
                Tên chương&nbsp;&nbsp;&nbsp;&nbsp; : 
                                    
            </td>
            <td style="height: 32px; width: 421px;">
                <asp:TextBox ID="txtChuonghoc" runat="server" Height="30px" 
                    TextMode="MultiLine" Width="270px"></asp:TextBox>
                
            </td>
            <td style="height: 32px; width: 471px;">
                </td>
        </tr>
        <tr>
            <td style="width: 117px">
                Tên môn học&nbsp;&nbsp;&nbsp;&nbsp;:
                </td>
            <td style="width: 421px">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:DropDownList ID="drlTenMonHoc" runat="server" 
    Height="25px" Width="270px" 
                    AutoPostBack="True" DataSourceID="LinqDataSource1" DataTextField="TenMonHoc" 
                    DataValueField="MsMonHoc">
                            <asp:ListItem Value="MaMon02">WIN</asp:ListItem>
                            <asp:ListItem Value="MaMon01">CSDL</asp:ListItem>
                        </asp:DropDownList>
                        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                    ContextTypeName="DataClassesDataContext" Select="new (MsMonHoc, TenMonHoc)" 
                    TableName="tbl_MONHOCs">
                        </asp:LinqDataSource>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td style="width: 471px">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False" CssClass="GridViewStyle" GridLines="None" 
                    DataSourceID="LinqDataSource2" Width="259px">
                            <Columns>
                                <asp:CommandField ShowSelectButton="True" />
                                <asp:BoundField DataField="MaChuong" HeaderText="Mã Chương" ReadOnly="True" 
            SortExpression="MaChuong" />
                                <asp:BoundField DataField="TenChuong" HeaderText="Tên Chương" ReadOnly="True" 
            SortExpression="TenChuong" />
                            </Columns>
                            <RowStyle CssClass="RowStyle" />
                            <EmptyDataRowStyle CssClass="EmptyRowStyle" />
                            <PagerStyle CssClass="PagerStyle" />
                            <SelectedRowStyle CssClass="SelectedRowStyle" />
                            <HeaderStyle CssClass="HeaderStyle" />
                            <EditRowStyle CssClass="EditRowStyle" />
                            <AlternatingRowStyle CssClass="AltRowStyle" />
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
                    ContextTypeName="DataClassesDataContext" Select="new (MaChuong, TenChuong)" 
                    TableName="tbl_CHUONGHOCs" Where="MsMonHoc == @MsMonHoc">
                    <WhereParameters>
                        <asp:ControlParameter ControlID="drlTenMonHoc" Name="MsMonHoc" 
                            PropertyName="SelectedValue" Type="String" />
                    </WhereParameters>
                </asp:LinqDataSource>
            </td>
        </tr>
        <tr>
            <td style="width: 117px">
            
                <br />
            
                <asp:Button class="button" ID="btnThemChuong" runat="server" Text="Thêm Chương" 
                    Height="27px" Width="109px" onclick="btnThemChuong_Click" />

                
                <br />
                
                &nbsp;</td>
            <td style="width: 421px">
            
                &nbsp;</td>
            <td style="width: 471px">
                &nbsp;</td>
        </tr>
    </table>

    

    

    <script type="text/javascript">
        function KtraChuong() {
            if ($.trim($("#<%=txtChuonghoc.ClientID%>").val()) == 0) {
                alert("Thông báo! Tên chương không được để trống!");
                return false;
            }
        }
    </script>
</asp:Content>


